package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(Long id);

    int insert(User record);

    User selectByPrimaryKey(Long id);

    List<User> selectAll();

    int updateByPrimaryKey(User record);

    User checkEmail(String email);

    User selectByInfo(@Param("email") String email, @Param("password") String password);

    List<User> selectForList(QueryObject qo);

    /*查询粉丝*/
    List<User> selectFans(@Param("id") Long userId);
    /*查询关注*/
    List<User> selectFollows(@Param("id") Long userId);


    /*设置总数增加*/
    void updateCountUp(@Param("id") Long userId,@Param("fansCount") Integer fansCount ,@Param("followCount") Integer followCount);
    /*设置总数减少*/
    void updateCountDown(@Param("id") Long userId,@Param("fansCount") Integer fansCount ,@Param("followCount") Integer followCount);
    /*查询所有未读总数*/
    List<Integer> countForAllNoRead(Long userId);
}